<template>
    <div class="goods-info-container">
        <h3>{{data.title}}</h3>
        <hr>
        <div class="content" v-html="data.content">
        </div>
    </div>
</template>

<script>
import { toast } from 'mint-ui';
export default {
    data(){
        return {
            id: this.$route.params.id,
            data: {}
        }
    },
    methods: {
        getData() {
            this.$http.get(`api/goods/getdesc/${this.id}`).then( res => {
                if(res.body.status == 0 ) {
                    this.data = res.body.message[0];
                    console.log(this.data);
                }
                else {
                    toast('获取数据失败');
                }
            });
        }
    },
    created() {
        this.getData();
    }
}
</script>

<style lang="less">
    .goods-info-container {
        padding: 0 4px;
        h3 {
            text-align: center;
            font-size: 14px;
            color: skyblue;
            margin: 12px 0;
        }
        .content {
            img {
                width: 100%;
            }
        }
    }
</style>